package com.itheima02.day06test;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author 刘全
 * @date 2021/7/22
 */
//1. 使用SimpleDateFormat类,把"2018-03-04"转换为"2018年03月04日"
public class Test1 {
    public static void main(String[] args) throws ParseException {
        String s = "2018-03-04";
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        Date d = sdf.parse(s);
        SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy年MM月dd日");
        System.out.println(sdf1.format(d));
    }
}
